#include<iostream>
using namespace std;

class A {
    public:
        virtual void f() {
            cout << "Call A" << endl;
        }
};

class B {
    public:
        virtual void f() {
            cout << "Call B" << endl;
        }
};

class C : public A,public B {
    public:
        void f() {
            cout << "Call C" << endl;
        }
};

int main() {
    A * pa;
    B pb;
    C c;
    A &ra = c;

    pa = &c;
    pa -> f();
    pb = c;
    pb.f();
    ra.f();

    return 0;

}
